package org.example.proxy;


import org.example.Loadbalance.LoadBalance;
import org.example.common.Invocation;
import org.example.common.Url;
import org.example.protocol.HttpClient;
import org.example.register.MapRegister;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.List;

//动态代理对象
//解决bean问题
public class ProxyFactory {

    public static <T> T getProxy(Class<T> interfaceClass) {
        //用户配置
        //动态代理
        Object proxyInstance = Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class[]{interfaceClass}, new ServiceProxy());
        return (T) proxyInstance;

    }
}
